/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GUI_VentanaInicial.java
 *
 * Created on 05/10/2011, 09:11:26 PM
 */
package swatsoft3.vista;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 * @param args the command line arguments
 */
// Variables declaration - do not modify
/**
 *
 * @author johanna
 */
public class GUI_VentanaInicial extends JFrame implements KeyListener {

    int primeraVez = 1;

    /** Creates new form GUI_VentanaInicial */
    public GUI_VentanaInicial() {
        initComponents();
        setTitle("SWATSoft");
        setVisible(true);
        this.setBounds(10, 10, 880, 650);
        this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                int resp = JOptionPane.showConfirmDialog(GUI_VentanaInicial.this, "Seguro que desea cerrar la ventana", "Confirmación", JOptionPane.YES_NO_CANCEL_OPTION);
                if (JOptionPane.YES_OPTION == resp) {
                    GUI_VentanaInicial.this.dispose();
                }

            }
        });
        this.btnProcesamiento.enableInputMethods(false);
        addKeyListener(this);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnFondo = new javax.swing.JButton();
        btnProcesarDocs = new javax.swing.JButton();
        btnProcesamiento = new javax.swing.JButton();
        btnSalir = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        btnFondo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/swatsoft3/imagenes/SWATSoft.png"))); // NOI18N
        btnFondo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFondoActionPerformed(evt);
            }
        });

        btnProcesarDocs.setBackground(java.awt.SystemColor.controlLtHighlight);
        btnProcesarDocs.setFont(new java.awt.Font("Ubuntu", 1, 14)); // NOI18N
        btnProcesarDocs.setForeground(new java.awt.Color(149, 184, 219));
        btnProcesarDocs.setIcon(new javax.swing.ImageIcon(getClass().getResource("/swatsoft3/imagenes/servidor-icono-mini.png"))); // NOI18N
        btnProcesarDocs.setText("Procesar documentos");
        btnProcesarDocs.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProcesarDocsActionPerformed(evt);
            }
        });
        btnProcesarDocs.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btnProcesarDocsKeyPressed(evt);
            }
        });

        btnProcesamiento.setBackground(java.awt.SystemColor.controlLtHighlight);
        btnProcesamiento.setFont(new java.awt.Font("Ubuntu", 1, 14)); // NOI18N
        btnProcesamiento.setForeground(new java.awt.Color(95, 152, 180));
        btnProcesamiento.setIcon(new javax.swing.ImageIcon(getClass().getResource("/swatsoft3/imagenes/analizando-icono-mini.png"))); // NOI18N
        btnProcesamiento.setText("Búsqueda de enfermedades");
        btnProcesamiento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProcesamientoActionPerformed(evt);
            }
        });

        btnSalir.setBackground(java.awt.SystemColor.controlLtHighlight);
        btnSalir.setFont(new java.awt.Font("Ubuntu", 1, 14)); // NOI18N
        btnSalir.setForeground(new java.awt.Color(95, 119, 177));
        btnSalir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/swatsoft3/imagenes/logout-icon-mini.png"))); // NOI18N
        btnSalir.setText("Salir");
        btnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalirActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btnProcesarDocs, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnProcesamiento, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnSalir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(btnFondo, javax.swing.GroupLayout.PREFERRED_SIZE, 846, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(291, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(btnFondo, javax.swing.GroupLayout.PREFERRED_SIZE, 520, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnProcesarDocs, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnProcesamiento, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void btnFondoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFondoActionPerformed
// TODO add your handling code here:
        //if (primeravez==1){ 
        //   GUI_InterfazPrincipal ip = new GUI_InterfazPrincipal();
        // primeravez++;
        JOptionPane.showMessageDialog(this, "Aquí va la lista de creadores.");

    }

    @Override
    public void keyTyped(KeyEvent e) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void keyReleased(KeyEvent e) {
        throw new UnsupportedOperationException("Not supported yet.");


}//GEN-LAST:event_btnFondoActionPerformed
private void btnProcesarDocsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProcesarDocsActionPerformed
// TODO add your handling code here:
    GUI_ProcesarDocumento procesarDocs = new GUI_ProcesarDocumento(this, true);
    procesarDocs.setVisible(true);
}//GEN-LAST:event_btnProcesarDocsActionPerformed

private void btnProcesarDocsKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnProcesarDocsKeyPressed
// TODO add your handling code here:
    // GUI_InterfazProcesamiento ip = new GUI_InterfazProcesamiento();
    //ip.setVisible(true);
}//GEN-LAST:event_btnProcesarDocsKeyPressed

private void btnProcesamientoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProcesamientoActionPerformed
// TODO add your handling code here:
    GUI_BuscarEnfermedad buscarEnfermedades = new GUI_BuscarEnfermedad(this, true);
    buscarEnfermedades.setVisible(true);
}//GEN-LAST:event_btnProcesamientoActionPerformed

private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
// TODO add your handling code here:

    int resp = JOptionPane.showConfirmDialog(GUI_VentanaInicial.this, "Seguro que desea salir de la aplicación", "Confirmación", JOptionPane.YES_NO_CANCEL_OPTION);
    if (JOptionPane.YES_OPTION == resp) {
        GUI_VentanaInicial.this.dispose();
    }
    //GUI_VentanaInicial.this.dispose();
}//GEN-LAST:event_btnSalirActionPerformed
    /**
     * @param args the command line arguments
     */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnFondo;
    private javax.swing.JButton btnProcesamiento;
    private javax.swing.JButton btnProcesarDocs;
    private javax.swing.JButton btnSalir;
    // End of variables declaration//GEN-END:variables

    @Override
    public void keyPressed(KeyEvent e) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
